package com.lhkj.ct.meta.modules.psychology.model.dto;

import com.lhkj.ct.base.validator.constraints.HasNonElement;
import com.lhkj.ct.meta.modules.psychology.model.entity.TblGaugeAnswer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Time;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *     作答提交
 * </p>
 */
@Setter
@Getter
public class ScaleSubmitDto implements Serializable {

    @NotBlank(message = "测验记录id不能为空")
    @ApiModelProperty(value = "测验记录id")
    private String allotId;

    @NotEmpty(message = "提交内容不能为空")
    @ApiModelProperty(value = "表单提交信息")
    private Map<String, Object> formData;

    @NotEmpty(message = "答卷记录不能为空")
    @HasNonElement(message = "答卷记录不能含有null值")
    @ApiModelProperty(value = "答卷记录")
    private List<TblGaugeAnswer> answerRecords;

    @ApiModelProperty(value = "是否匿名", notes = "问卷提交时需要")
    private boolean anonymous;

    @NotBlank(message = "答案json不能为空")
    @ApiModelProperty(value = "答案json")
    private String answerJson;

    @NotNull(message = "计时不能为空")
    @ApiModelProperty(value = "计时")
    private Time costTime;

}
